package com.rules.admin.domain;

import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import java.io.Serializable;

public class SysResource implements Serializable {
    private String resourceId;
    private String url;
    private ImmutableSet<SysResource> children;

    public SysResource() {
    }

    public SysResource(String url) {
        this.url = url;
    }

    public String getResourceId() {
        return this.resourceId;
    }

    public SysResource setResourceId(String resourceId) {
        this.resourceId = resourceId;
        return this;
    }

    public String getUrl() {
        return this.url;
    }

    public SysResource setUrl(String url) {
        this.url = url;
        return this;
    }

    public ImmutableSet<SysResource> getChildren() {
        return this.children;
    }

    public SysResource setChildren(Iterable<SysResource> children) {
        this.children = ImmutableSet.copyOf(children);
        return this;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (!(o instanceof SysResource)) {
            return false;
        } else {
            SysResource that = (SysResource)o;
            return Objects.equal(this.url, that.url) && Objects.equal(this.children, that.children);
        }
    }

    public int hashCode() {
        return Objects.hashCode(new Object[]{this.url, this.children});
    }
}

